package com.ruoyi.web.controller.wx;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.wx.service.IWxMpAppService;

/**
 * 公众号应用表Controller
 * 
 * @author ruoyi
 * @date 2022-03-29
 */
@RestController
@RequestMapping("/wx/mpApp")
public class WxMpAppController extends BaseController {

	@Autowired
	private IWxMpAppService wxMpAppService;
	
	@Autowired
	private ISysUserService sysUserService;
	
	/**
     * 查询公众号二维码
     */
    @GetMapping("/getQrCode")
    public R getQrCode() {
    	SysUser user = sysUserService.getById(SecurityUtils.getUserId());
    	List<String> data = wxMpAppService.getQrCode(user.getAppId());
        return R.ok(data);
    }
    
}
